import request from '@/utils/request'

// 查询第三方渠道列表
export function listChannel(query) {
  return request({
    url: '/third/h5channel/list',
    method: 'get',
    params: query
  })
}

// 查询第三方渠道详细
export function getChannel(id) {
  return request({
    url: '/third/h5channel/' + id,
    method: 'get'
  })
}

// 新增第三方渠道
export function addChannel(data) {
  return request({
    url: '/third/h5channel',
    method: 'post',
    data: data
  })
}

// 新增第三方渠道
export function bindChannel(data) {
  return request({
    url: '/third/h5channel/bind/' + data.id + '/' + data.mobile,
    method: 'post',
    // data: data
  })
}

// 修改第三方渠道
export function updateChannel(data) {
  return request({
    url: '/third/h5channel',
    method: 'put',
    data: data
  })
}

// 删除第三方渠道
export function delChannel(id) {
  return request({
    url: '/third/h5channel/' + id,
    method: 'delete'
  })
}

// 导出第三方渠道
export function exportChannel(query) {
  return request({
    url: '/third/h5channel/export',
    method: 'get',
    params: query
  })
}
